package tuanda.soict.firstsun.BuildingPackage;

/**
 * @author tuanda_soict_hut
 * @version 0.0.1
 * @since 25-7-2012
 */
public class HQ_Building extends HP_Building {

    private int turns_before_lost;

    public HQ_Building(String nam, int def, int groID,
            int obsPoint, int typ, int goldProd, int hp, int x, int y, int dataID) {
        super(nam, def, DEFAULT_MAX_BUILDING_PER_GROUP,
                groID, obsPoint, typ, goldProd, hp, x, y, dataID);
        setTurnsBeforeLost(MANY_TURNS);
    }

    public final int getTurnsBeforeLost() {
        return this.turns_before_lost;
    }

    public final void setTurnsBeforeLost(int dayLeft) {
        this.turns_before_lost = dayLeft;
    }

    public final void occupy() {
        if (getTurnsBeforeLost() == MANY_TURNS) {
            setTurnsBeforeLost(TURNS_TO_DEATH);
        }
    }

    @Override
    public int getBuildingType() {
        return HEAD_QUARTER_TYPE;
    }
}
